home *** CD-ROM | disk | FTP | other *** search
- COPYERRS version 1.1 07-28-88
-
- Send correspondence to:
-
- Kevin Rice
- 5436 Willowick Circle
- Anaheim, CA 92807-4633
- (714) 637-1673 - voice
-
- COPYERRS is written as a tool for use with all PseudoSam assemblers to provide
- the following features:
-
- * copies error messages from the .LST file output from the assembler into the
- .ASM source file so that errors may be edited without having to go back and
- forth between the two files. A switch is provided so that COPYERRS will leave
- your original .ASM file untouched, if you prefer, and output the error
- augmented source to a file with the extension .ERR.
-
- * removes error messages previously inserted into the source file so that they
- do not have to be manually removed after correcting the errors.
-
- * supports two error levels for batch file processing. The PseudoSam assembler
- provides no error level output. With COPYERRS, batch files can determine
- whether or not an error occurred during assembly.
-
- * corrects error pointer (caret symbol '^') to point to error even when tabs
- are used in the source file. The PseudoSam assembler treats tabs as one space
- and will point incorrectly when tabs are used in the source file.
-
- This sofware is FREE and NOT copyrighted - enjoy!
-
- This is not a perfect program, but if you find any major bugs, let me know and
- I will try to fix them. Source code is available if anyone is interested.
-
- The format for using COPYERRS is:
-
- COPYERRS [-o|-r] filename
-
- WHERE:
-
- * filename is the complete path and name (less extension) of the source and
- list files (.ASM and .LST)
-
- * -o will cause COPYERRS to leave your source file untouched and write the
- error agmented source to filename.ERR
-
- * -r will cause COPYERRS to remove error messages from the source file named
- filename.ASM
-
- EXAMPLES:
-
- COPYERRS \a51\myprog - inserts error messages from myprog.LST
- into myprog.ASM in the directory a51
-
- COPYERRS -o foo - inserts error messages from foo.LST
- into the source code from foo.ASM and
- writes it to a file named foo.ERR
- foo.ASM is not changed
-
- COPYERRS -r test - removes error messages previously
- inserted into test.ASM
-
-
- WARNING:
-
- COPYERRS always creates a temporary file named filename.ERR. If filename.ERR
- exists on the disk it will be overwritten!
-
- A NOTE ABOUT THE EJECT DIRECTIVE
-
- The eject directive cannot be used in your source files. This is because
- COPYERRS copies error messages line-by-line from the list file. The PseudoSam
- assemblers do not output a line for the eject directive which throws COPYERRS
- off by one line for each eject. I could have counted the form feed character
- as a line to get around this, but the assembler also inserts ejects every few
- lines automatically to skip perforations when the list file is printed (these
- don't count). It's still possible to account for both situations, but I
- decided it wasn't worth the effort required to support it (yet). The source
- for COPYERRS is available free if anybody feels ambitious.
-
- BATCH FILE PROCESSING
-
- COPYERRS supports two error levels which may be tested for in a batch file
- using the errorlevel variable. After execution of COPYERRS, the errorlevel
- variable will be set to one of:
-
- ERRORLEVEL 0 - indicates that COPYERRS executed successfully with
- no errors. If COPYERRS was used to copy error
- messages, errorlevel 0 also indicates that no
- errors were present in the .LST file. This can
- be used in conjunction with ERRORLEVEL 2 to
- determine if a no errors assembly occured.
-
- ERRORLEVEL 1 - indicates that an error occurred preventing
- COPYERRS from executing. COPYERRS will display an
- error message to the screen as to what happened.
- Most likely the filename was typed incorrectly or
- filname was not found in the specified directory.
-
- ERRORLEVEL 2 - this error will only occur when COPYERRS is used
- to copy error messages (when the -r switch is not
- used). This error indicates that error messages
- were found in the .LST file and copied. By
- executing COPYERRS, a batch file can determine
- whether or not an error occurred during assembly
- and possibly return to a text editor to correct
- errors.
-
- Here is an example of errorlevel usage in a batch file: Comments are inserted
- within parenthesis ()
-
- COPYERRS -R MYPROG (remove previous error messages)
- IF ERRORLEVEL 1 GOTO ERROR (test if error occured in COPYERRS)
- A51 MYPROG (assemble source file MYPROG.ASM)
- COPYERRS MYPROG (insert error messages from MYPROG.LST into MYPROG.ASM)
- IF ERRORLEVEL 2 GOTO EDIT (jump to editor if errors found)
- IF ERRORLEVEL 1 GOTO ERROR (test if error occured in COPYERRS)
- ECHO MYPROG.ASM ASSEMBLED WITH NO ERRORS
- GOTO END
- :EDIT
- (insert name of text editor here) MYPROG
- GOTO END
- :ERROR
- ECHO ERROR EXECUTING COPYERRS
- :END
-
- Be sure to always check for higher numbered errorlevels first as DOS thinks
- that ERRORLEVEL 1 is true if ERRORLEVEL 2 is set.